fix(middleware): drain websocket session end streams - #3143
Merged
Conversation
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
pimlock
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 2, 2026 19:04
|
🌿 Preview your docs: https://nvidia-preview-pr-3143.docs.buildwithfern.com/openshell |
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
johntmyers
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent WebSocket middleware session-end notifications from being canceled with their bidirectional gRPC stream. The supervisor now half-closes the request side and briefly drains the response side before releasing the transport.
Related Issue
No issue required: localized lifecycle fix found while investigating the Rust test hang in #3085.
Changes
Before and after
sequenceDiagram participant S as Supervisor participant H as tonic / h2 participant M as Middleware Note over S,M: Previous shutdown S->>H: Queue session_end S-xH: Drop request and response handles H--xM: RST_STREAM(CANCEL) may discard session_end Note over S,M: Graceful shutdown S->>H: Queue session_end S->>H: Drop request sender to half-close H->>M: Deliver session_end, then request EOF M-->>H: Finish response stream H-->>S: Drain completes or reaches the 10 ms boundTesting
mise run pre-commitpassescargo test --workspace --exclude openshell-serverpassescargo test -p openshell-server --features test-supportpassesopenshell-supervisor-middlewaretests passChecklist